package com.easyfun.healthmagicbox.alarmclock;

import android.content.Context;
import android.media.MediaPlayer;

import com.easyfun.healthmagicbox.R;

class MediaPlayerInstanse{

	private static MediaPlayer alarmMusic;
	private static MediaPlayerInstanse instance;
	private MediaPlayerInstanse(Context context)
	{
		// 加载指定音乐，并为之创建MediaPlayer对象
		alarmMusic = MediaPlayer.create(context, R.raw.beep);
		alarmMusic.setLooping(true);
		// 播放音乐
	}
	
	public static MediaPlayerInstanse getInstance(Context context)
	{
		if (instance == null)
		{
			instance = new MediaPlayerInstanse(context);
		}
		return instance;
	}
	
	public MediaPlayer getMediaPlayer()
	{
		return alarmMusic;
	}
}
